/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package daos;

import beans.Bean;
import beans.TipoUsuarioBean;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author C
 */
public class MSSQLTipoUsuarioDao extends MSSQLDao implements Dao{

    public MSSQLTipoUsuarioDao() throws Exception {
        super();
    }   

    @Override
    public Bean make(ResultSet result) throws Exception {
        TipoUsuarioBean t= new TipoUsuarioBean();
        t.setIdTipo(result.getInt("id_tipo")); 
        t.setTipo(result.getString("descripcion"));       
        return t;
    }

    @Override
    public long insert(Bean bean) throws Exception {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void update(Bean bean) throws Exception {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void delete(Bean bean) throws Exception {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public List<Bean> select(Bean bean) throws Exception {
        ResultSet result;
        List<Bean> resultados = new ArrayList<Bean>();
        this.setStatement("get_tipos_usuarios");        
        result = this.getStatement().executeQuery();       
        while(result.next()) {
            resultados.add(this.make(result));
        }        
        return resultados;  
    }

    @Override
    public boolean valid(Bean bean) throws Exception {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public Bean get(Bean bean) throws Exception {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public long getSize(Bean bean) throws Exception {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    
}
